package reviewQuiz

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method "POST"
        url "api/v2/review"
        headers {
            contentType(applicationJsonUtf8())
            header("id",21)
        }
        body("""
            {
                "status":"已完成" 
            }
        """)
        bodyMatchers {
            jsonPath('$.status', byRegex(nonEmpty()))
        }
    }
    response {
        status 201
        bodyMatchers {
            jsonPath('$.id', byRegex(number()))
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
}